package com.prs.crm.action.cqunicom;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;

import com.prs.crm.cqunicom.LogsaveImpl;
import com.prs.crm.domain.cqunicom.LogSerch;
import com.prs.crm.service.cqunicom.LogSerchService;

/**
 * @author LanXiaoGang
 * @E-mail:lan9liang@163.com
 * @qq:7857553326
 * @version 创建时间：2011-3-2 下午05:10:02
 * 简单说明
 */

public class LogSerchAction extends BaseAction {
	
	private static final long serialVersionUID = 1L;

	private PaginationSupport pagination;
	
	private LogSerch logSerch;
	
	private LogSerchService logSerchService;
	
	
	
	@Action("listLogSerch")
	public String listLogSerch() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(LogSerch.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getLogSerchService().listByPage(criteria,pagination));
		return SUCCESS;
	}

	/**
	 * 日志保存方法
	 * @param name
	 * @param contents
	 */
	public  synchronized void saveLog(String name,String contents){
		LogSerch LS=new LogSerch();
		LS.setCandlePeron(name);
		LS.setCandleContents(contents);
        this.getLogSerchService().save(LS);
	}
	
	
	
	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public LogSerch getLogSerch() {
		return logSerch;
	}

	public void setLogSerch(LogSerch logSerch) {
		this.logSerch = logSerch;
	}

	public LogSerchService getLogSerchService() {
		return logSerchService;
	}

	public void setLogSerchService(LogSerchService logSerchService) {
		this.logSerchService = logSerchService;
	}

	
	
	

}
